package com.zwjlg.aroutemoduleservice;

import java.lang.reflect.Method;

/**
 * ================================================
 * <p>
 * Created by ligang on 2021/4/6 10:45
 * ================================================
 */
public class DebugClass {
    public static String read2(){
        return "修改之前的";
//        return "修改之后的》》》》》》》";
    }

    public static String read() {
        try {
            try {
                Class c = Class.forName("com.lg.hack.XieMeng");
                System.out.println("c:" + c);
                Method[] declaredMethods = c.getDeclaredMethods();
                System.out.println("declaredMethods:" + declaredMethods.length);
                for(Method method : declaredMethods){
                    System.out.println("method:" + method);
                }

                Method[] methods  = c.getMethods();
                System.out.println("methods:" + methods.length);
                for(Method method : methods){
                    System.out.println("method:" + method);
                }
                Method getContent = c.getDeclaredMethod("getContent");
                Object invoke = getContent.invoke(null);
                return invoke.toString();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            } catch (NoSuchMethodException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            }
        } catch (Exception e) {

        }
        return "bug";
    }
}
